home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-ARM / ARCH-ARC / IDE.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  1KB  |  52 lines

  1. /*
  2.  * linux/include/asm-arm/arch-arc/ide.h
  3.  *
  4.  * Copyright (c) 1997,1998 Russell King
  5.  *
  6.  * IDE definitions for the Acorn Archimedes/A5000
  7.  * architecture
  8.  *
  9.  * Modifications:
  10.  *  04-04-1998    PJB    Merged `arc' and `a5k' versions
  11.  *  01-07-1998    RMK    Added new ide_ioregspec_t
  12.  *  29-07-1998    RMK    Major re-work of IDE architecture specific code
  13.  */
  14.  
  15. #include <linux/config.h>
  16. #include <asm/irq.h>
  17.  
  18. /*
  19.  * Set up a hw structure for a specified data port, control port and IRQ.
  20.  * This should follow whatever the default interface uses.
  21.  */
  22. static __inline__ void
  23. ide_init_hwif_ports(hw_regs_t *hw, int data_port, int ctrl_port, int irq)
  24. {
  25.     ide_ioreg_t reg = (ide_ioreg_t) data_port;
  26.     int i;
  27.  
  28.     memset(hw, 0, sizeof(*hw));
  29.  
  30.     for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
  31.         hw->io_ports[i] = reg;
  32.         reg += 1;
  33.     }
  34.     hw->io_ports[IDE_CONTROL_OFFSET] = (ide_ioreg_t) ctrl_port;
  35.     hw->irq = irq;
  36. }
  37.  
  38. /*
  39.  * This registers the standard ports for this architecture with the IDE
  40.  * driver.
  41.  */
  42. static __inline__ void
  43. ide_init_default_hwifs(void)
  44. {
  45. #ifdef CONFIG_ARCH_A5K
  46.     hw_regs_t hw;
  47.  
  48.     ide_init_hwif_ports(&hw, 0x1f0, 0x3f6, IRQ_HARDDISK);
  49.     ide_register_hw(&hw, NULL);
  50. #endif
  51. }
  52.